import { http } from "@/utils/http";
import httpConfig from "@/utils/http/httpConfig";

const typePre = httpConfig.system + "/tenant/type";
const pre = httpConfig.system + "/tenant";

export function typePage(params: any) {
  return http.post(typePre + "/page", { data: params });
}

export function typeList(params: any) {
  return http.post(typePre + "/list", { data: params });
}

/**
 * 添加租户类型
 * @param params
 * @returns
 */
export function typeAdd(params: any) {
  return http.post(typePre + "/add", { data: params });
}

export function typeEdit(params: any) {
  return http.post(typePre + "/edit", { data: params });
}
/**
 * 授权租户类型
 * @param params
 * @returns
 */
export function typeAuth(params: any) {
  return http.post(typePre + "/auth/" + params.typeId, {
    data: params.menuIds
  });
}

/**
 * 添加租户
 * @param params
 * @returns
 */
export function addTenant(params: any) {
  return http.post(pre + "/add", { data: params });
}
export function editTenant(params: any) {
  return http.post(pre + "/edit", params, { data: params });
}

export function delTenant(params: any) {
  return http.post(pre + "/del", { data: params });
}
export function pageTenant(params: any) {
  return http.post(pre + "/page", { data: params });
}
